package com.ethank.enums.ali;

import com.ethank.entity.VoucherResponseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * 航空行程单
 * @Description type 1- input 文本 2-日期 3-时间
 */

public enum AirItineraryEnum {
    TYPE("type", "类型", "", 1, false),
    INTERNATIONALFLIGHTSIGN("internationalFlightSign", "国内国际标签", "", 1, false),
    SERIALNUMBER("serialNumber", "印刷序号", "", 1, false),
    PASSENGERNAME("passengerName", "旅客姓名", "", 1, true),
    IDCARDNUMBER("idCardNumber", "有效身份证号码", "", 1, true),
    ENDORSEMENT("endorsement", "签注", "", 1, false),
    FARE("fare", "票价", "", 1, false),
    CAACDEVELOPMENTFUND("caacDevelopmentFund", "民航发展基金", "", 1, false),
    FUELSURCHARGE("fuelSurcharge", "燃油附加费", "", 1, false),
    TOTALAMOUNT("totalAmount", "合计", "", 1, true),
    TICKETNUMBER("ticketNumber", "电子客票号码", "", 1, false),
    VALIDATIONCODE("validationCode", "验证码", "", 1, false),
    PROMPTMESSAGE("promptMessage", "提示信息", "", 1, false),
    INSURANCE("insurance", "保险费", "", 1, false),
    AGENTCODE("agentCode", "销售单位代号", "", 1, false),
    ISSUECOMPANY("issueCompany", "填开单位", "", 1, false),
    ISSUEDATE("issueDate", "填开日期", "", 2, false),
    PNRCODE("pnrCode", "PNR 码", "", 1, false),
    OTHERTAXES("otherTaxes", "其他税费", "", 1, false),
    DEPARTURESTATION("departureStation", "出发站", "", 1, false),
    ARRIVALSTATION("arrivalStation", "到达站", "", 1, false),
    CARRIER("carrier", "承运人", "", 1, false),
    FLIGHTNUMBER("flightNumber", "航班号", "", 1, false),
    CABINCLASS("cabinClass", "舱位等级", "", 1, false),
    FLIGHTDATE("flightDate", "乘机日期", "", 2, false),
    FLIGHTTIME("flightTime", "乘机时间", "", 3, false),
    SEATCLASS("seatClass", "座位等级", "", 1, false),
    VALIDFROMDATE("validFromDate", "客票生效日期", "", 2, false),
    VALIDTODATE("validToDate", "有效截止日期", "", 2, false),
    FREEBAGGAGEALLOWANCE("freeBaggageAllowance", "免费行李", "", 1, false);

    private String key;
    private String label;
    private String value;
    private Integer type;
    private boolean required;

    AirItineraryEnum() {
    }

    AirItineraryEnum(String key, String label, String value, Integer type, boolean required) {
        this.key = key;
        this.label = label;
        this.value = value;
        this.type = type;
        this.required = required;
    }

    public static List<VoucherResponseVO> convertVoucher() {
        ArrayList<VoucherResponseVO> vos = new ArrayList<>();
        for (AirItineraryEnum fieldEnum : AirItineraryEnum.values()) {
            VoucherResponseVO vo = new VoucherResponseVO();
            vo.setKey(fieldEnum.getKey());
            vo.setLabel(fieldEnum.getLabel());
            vo.setType(fieldEnum.getType());
            vo.setRequired(fieldEnum.getRequired());
            vos.add(vo);
        }
        return vos;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean getRequired() {
        return required;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }
}
